import axios from "axios";

const instance = axios.create({
    baseURL: 'http://180.76.236.114:3006',
    timeout: 3000
})

instance.interceptors.request.use(config => {
    const token = localStorage.getItem('token');
    if (token) {
        config.headers.Authorization = `Bearer ${token}`
    }
    return config
}, error => {
    return error
})

instance.interceptors.response.use(response => {
    return response
}, error => {
    return error
})

export default instance